package rdd.builder

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.rdd.RDD

object Spark02_RDD_WholeFile2 {

  def main(args: Array[String]): Unit = {

    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("memoryRDD")
    val sc = new SparkContext(sparkConf)

    // 创建RDD
    // 1. wholeTextFile读取文件
    val rdd: RDD[(String, String)] = sc.wholeTextFiles("datasets/wc")

    rdd.collect().foreach(println)

    // 退出环境
    sc.stop()
  }
}
